<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
import {title} from "./settings.js"

export default {
  name: 'App',
  methods: {
    titleTemplate(dynamicTitle) {
      return dynamicTitle ? `${dynamicTitle} - ${title}` : title
    }
  },
  computed: {
    dynamicTitle: {
      get() {
        return this.$store.state.settings.dynamicTitle && this.$store.state.settings.title
      },
    }
  },
  watch: {
    dynamicTitle(value) {
      let dynamicTitle = title;
      if (value) {
        const title = this.$store.state.settings.title
        dynamicTitle = this.titleTemplate(title);
      }
      document.getElementsByTagName("title")[0].innerText = dynamicTitle;
    },
  },
}
</script>

<style lang="less">
.el-input.style{
  width: 80%
}
.el-select{
  width: 80%;
}
.el-select-dropdown__item {
  text-align: center;
}

//新增，编辑窗口宽度
.el-card .el-dialog{
  width: 35%;
}
</style>
